﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace TagThisOrgProject.Settings
{
    public class Settings
    {
        //Dictionary<string, string> s = new Dictionary<string, string> { { "s", "s" } };
        private static Settings _settings = null;
        private Settings()
        {
            _tagSeparatorSearch = new List<char> { ',', ' ', '\\', ';', '/', '<', '>', '=', '`', '~', '&' };
            _tagSeparatorsCreate = new List<char> { '|', '!', '?', '*' };
            _tagSeparatorsCreate.AddRange(_tagSeparatorSearch); ;
        }
        public static Settings Instanse
        {
            get
            {

                if (_settings == null)
                {
                    _settings = new Settings();
                }

                return _settings;
            }
        }

        public string AnonimusUserName { get { return "Anonumus"; } }
        public string AnonimusEmail { get { return "nothing@nothing.nothing"; } }
        private List<char> _tagSeparatorSearch;
        private List<char> _tagSeparatorsCreate;
        public List<char> TagSeparatorsSearch { get { return _tagSeparatorSearch; } }
        public List<char> TagSeparatorsCreate { get { return _tagSeparatorsCreate; } }
        public MvcHtmlString SeparatorRegExString
        {
            get
            {
                var resultString = @"/\s*[";//,\s*/\
                foreach (var item in _tagSeparatorSearch)
                {
                    resultString += item;
                }
                resultString += @"]\s*/";
                return new MvcHtmlString(resultString);
            }
        }
    }
}